export = {
    env: {
        es6: true,
        node: true,
        jest: true,
        browser: true
    },
    extends: [

        'plugin:react/recommended',
        'plugin:react-hooks/recommended',
        'plugin:@typescript-eslint/recommended',
        'plugin:markdown/recommended',
    ],

    plugins: [
        'html', 'react', 'react-hooks'
    ],
    overrides: [
        {
            files: ['**/*.ts?(x)'],
            parser: require.resolve('@typescript-eslint/parser'),
            parserOptions: {
                ecmaVersion: 6,
                sourceType: 'module',
                ecmaFeatures: {
                    jsx: true
                },
                warnOnUnsupportedTypeScriptVersion: true
            },
            plugins: ['@typescript-eslint/eslint-plugin'],
        },
        {
            files: ['**/*.{md}'],
            processor: 'markdown/markdown',
            plugins: ['markdown']
        },
        {
            files: [
                '**/*.md/*.ts',
                '**/*.md/*.tsx',
                '**/*.md/*.js',
                '**/*.md/*.jsx'
            ],
            rules: {
                'unused-imports/no-unused-imports': 0,
                'no-alert': 'error',
            }
        },
        {
            files: '**/*.{mdx}',
            plugins: ["plugin:mdx/recommended"],
            rules: {
                'react/no-unescaped-entities': 'warn',
                'no-alert': 'error',
            },
            settings: {
                'mdx/code-blocks': true,
            }
        }
    ],
    globals: {
        Window: true
    },
    rules: {
        'react/jsx-max-props-per-line': [
            1,
            {
                maximum: 3,
                when: 'multiline'
            }
        ],
        'react-hooks/rules-of-hooks': 'error', // 检查 Hook 的规则
        'react-hooks/exhaustive-deps': 'warn', // 检查 effect 的依赖
        'no-console': 'error',
        'no-alert': 'error',
    }

}


